import Vue from 'vue'
import Vuex from 'vuex'
import getters from './getters'
import app from './modules/app'
import user from './modules/user'
import permission from './modules/permission'
import createPersistedState from 'vuex-persistedstate'
import mapModular from './modules/mapModular'

Vue.use(Vuex)
const appState = createPersistedState({
  paths: ['app']
})
const store = new Vuex.Store({
  modules: {
    app,
    user,
    permission,
    mapModular
  },
  getters,
  plugins: [appState]
})

export default store
